var limsFilemanagement = Gikam.getPageObject({

    getEditListColumns: function () {
        return [{
            checkbox: true
        }, {
            index: true
        }, {
            field: 'fileCode',
            validators: ['notEmpty', 'strLength[0,30]', 'unique[/secure/basemodule/rm/filemanagements/action/validate-unique]'],
            title: 'T_LIMS_FILEMANAGEMENT.FILECODE',
            width: 110,
            type: 'link'
        }, {
            field: 'fileName',
            validators: ['notEmpty', 'strLength[0,50]'],
            title: 'T_LIMS_FILEMANAGEMENT.FILENAME',
            width: 110
        }, {
            field: 'fileType',
            title: 'T_LIMS_FILEMANAGEMENT.FILETYPE',
            type: 'select',
            search: true,
            preInsert: true,
            validators: ['notEmpty'],
            category: 'sys',
            param: {
                codeCategoryId: 'fileCategory'
            },
            width: 110
        }, {
            field: 'person',
            title: 'T_LIMS_FILEMANAGEMENT.PERSON',
            width: 160
        }, {
            field: 'createdByName',
            width: 110,
            title: 'T_LIMS_FILEMANAGEMENT.CREATEDBYNAME'
        }, {
            field: 'createdTime',
            title: 'T_LIMS_FILEMANAGEMENT.CREATEDTIME',
            width: 150,
            type: 'dateTime'
        },]
    },

    getBaseInfoFormFields: function () {
        return [{
            field: 'fileCode',
            title: 'T_LIMS_FILEMANAGEMENT.FILECODE',
            validators: ['notEmpty', 'strLength[0,30]', 'unique[/secure/basemodule/rm/filemanagements/action/validate-unique]'],
            preInsert: true
        }, {
            field: 'fileName',
            title: 'T_LIMS_FILEMANAGEMENT.FILENAME',
            validators: ['notEmpty', 'strLength[0,50]'],
            preInsert: true
        }, {
            field: 'fileType',
            title: 'T_LIMS_FILEMANAGEMENT.FILETYPE',
            validators: ['notEmpty'],
            preInsert: true,
            type: 'select',
            firstBlank: false,
            category: 'sys',
            param: {
                codeCategoryId: 'fileCategory'
            }
        },]
    },

    getSearchListColumns: function () {
        return [{
            checkbox: true
        }, {
            index: true
        }, {
            field: 'fileCode',
            title: 'T_LIMS_FILEMANAGEMENT.FILECODE',
            width: 110,
            type: 'link'
        }, {
            field: 'fileName',
            title: 'T_LIMS_FILEMANAGEMENT.FILENAME',
            width: 110
        }, {
            field: 'fileType',
            title: 'T_LIMS_FILEMANAGEMENT.FILETYPE',
            type: 'select',
            firstBlank: false,
            category: 'sys',
            param: {
                codeCategoryId: 'fileCategory'
            },
            width: 110
        }, {
            field: 'person',
            title: 'T_LIMS_FILEMANAGEMENT.PERSON',
            width: 160
        }, {
            field: 'createdByName',
            width: 110,
            title: 'T_LIMS_FILEMANAGEMENT.CREATEDBYNAME'
        }, {
            field: 'createdTime',
            title: 'T_LIMS_FILEMANAGEMENT.CREATEDTIME',
            width: 150,
            type: 'dateTime'
        },]
    },

    getChooseListColumns: function () {
        return [{index: true},{
            field: 'fileCode',
            title: 'T_LIMS_FILEMANAGEMENT.FILECODE'
        }, {
            field: 'fileName',
            title: 'T_LIMS_FILEMANAGEMENT.FILENAME'
        }, {
            field: 'fileType',
            title: 'T_LIMS_FILEMANAGEMENT.FILETYPE',
            type: 'select',
            firstBlank: false,
            category: 'sys',
            param: {
                codeCategoryId: 'fileCategory'
            },
        }, {
            field: 'person',
            title: 'T_LIMS_FILEMANAGEMENT.PERSON'
        }, {
            field: 'createdByName',
            width: 110,
            title: 'T_LIMS_FILEMANAGEMENT.CREATEDBYNAME'
        }, {
            field: 'createdTime',
            title: 'T_LIMS_FILEMANAGEMENT.CREATEDTIME',
            width: 150,
            type: 'dateTime'
        },]
    },

    baseUrl: IFM_CONTEXT + '/secure/basemodule/rm/filemanagements',

    loadFileManagementDetailPage: function (row, step) {
        workspace.window.load(limsFilemanagement.baseUrl + '/page/detail-page' + Gikam.param({
            id: row.id,
            step: step
        }))
    }
})
